const tags = {
    name: "order",
    description: "订单管理模块",
}
const schemas = {
    orderRetuen: {
        properties: {
            total: {
                type: "number",
                description: "总数",
            },
            maxPage: {
                type: "number",
                description: "总页",
            },
            rows: {
                type: "Array",
                description: "当页数据",
                items: {
                    $ref: "#/components/schemas/rowsReturn",
                }

            },
        },
    },
    rowsReturn: {
        properties: {
            cinemaData: {
                type: "Object",
                description: "这个订单对应影院所有的数据",
            },
            theaterData: {
                type: "Object",
                description: "这个订单对应放映厅所有的数据",
            },
            movieData: {
                type: "Object",
                description: "这个订单对应电影所有的数据",
            },
            showTime: {
                type: "string",
                description: "电影的放映时间",
            },
            price: {
                type: "number",
                description: "价格",
            },
            seat: {
                type: "Object",
                description: "这个订单对应座位所有的数据",
            },
            userId: {
                type: "string",
                description: "这个订单对应的购买用户id",
            },
        }
    }

}
const paths = {
    "/order": {
        get: {
            tags: ["order"],
            summary: "获取当页所有订单",
            description: "传入当前也和每页显示条数获取当页所有订单", // 具体描述
            consumes: ["application/json"],
            // parameters 请求参数
            parameters: [
                {
                    name: "curPage",
                    in: "query",    //get类型的参数在query中获取
                    schema: {
                        type: "integer",   //integer 整数
                        default: 1,
                    },
                    required: true,  //必填
                    description: "当前⻚码",
                },
                {
                    name: "eachPage",
                    in: "query",
                    schema: {
                        type: "integer",
                        default: 1,
                    },
                    required: true,
                    description: "每⻚显示条数",
                },
            ],
            responses: {
                200: {
                    description: "操作成功",
                    content: {
                        "application/json": {
                            schema: {
                                $ref: "#/components/schemas/orderRetuen",
                            },
                        },
                    },
                },
                404: {
                    description: "找不到资源",
                },
            },
        },
    },
}
module.exports = { tags, schemas, paths }